package com.yanyu.space.common.gateway.handler;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor;
import org.springframework.beans.factory.support.GenericBeanDefinition;

/**
 * @author gz
 */
public class SentinelGatewayExceptionHandlerBean implements BeanDefinitionRegistryPostProcessor {
    @Override
    public void postProcessBeanDefinitionRegistry(
            BeanDefinitionRegistry registry) throws BeansException {
        GenericBeanDefinition gbdefinition = new GenericBeanDefinition();
        gbdefinition.setBeanClass(SentinelGatewayExceptionHandler.class);
        registry.registerBeanDefinition("sentinelBlockRequestHandler", gbdefinition);
    }

    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {

    }
}
